{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-slideshow.tpl"}</nav>
    <article class="right-col">
        <h2><a href="{$smarty.const.HOST_BACKEND}slideshow?type={$smarty.get.type}">Album ảnh {$arrSmarty.slideshows[$smarty.get.type]}</a> &raquo; {if $intForm == 0}Thêm mới{elseif $intForm==1}Đăng hình{elseif $intForm == 2}Cập nhật{/if}</h2>
        <form name="frmUpload" id="frmUpload" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}slideshow/doupload" class="ui">                        	
        	<input type="hidden" name="pform" id="pform" value="{$intForm}" />
            <input type="hidden" name="ptype" id="ptype" value="{$smarty.get.type}" />
            {if $intForm > 0}
                <input type="hidden" name="palbumid" id="palbumid" value="{$intAlbumId}" />
            {/if}
            <ul>
            	{if isset($smarty.session.SLIDESHOW_ERROR) && $smarty.session.SLIDESHOW_ERROR|@count > 0}
                    <li class="error">
                    	{include file="common/error.tpl" dataSession=$smarty.session.SLIDESHOW_ERROR}                        
                    </li>
                {/if} 
                <li>
                	{if $arrAlbum}
                    
                        <label for="palbumid">Album ảnh:</label>
                        <div class="sel">
                            <select id="palbumid" name="palbumid">
                                <option value="0">--Chọn--</option>
                                {foreach item=item from=$arrAlbum}
                                    <option value="{$item.albumid}" {if $intAlbumId == $item.albumid}selected="selected"{/if}>{$item.name} ({$item.timage} hình)</option>
                                {/foreach}
                            </select>
                        </div>
               		{else}
                		<label for="pal_name">Tên album ảnh <span class="required">*</span>:</label>
                        <div class="txt">
                    		<input type="text" value="{if isset($smarty.session.SLIDESHOW_POST.pal_name)}{$smarty.session.SLIDESHOW_POST.pal_name}{else}{$row.name}{/if}" name="pal_name" id="pal_name" class="text" maxlength="255" />         
                        </div>
                	{/if}              
                 </li> 
                 {if $intForm < 2}
                     <li>
                        <label for="pimage">Hình trong album <span class="required">*</span>:</label>
                        <div class="txt">
                            <input type="file" class="text" name="pimage" id="pimage" value="" />
                        </div>
                     </li>
                     <li>
                     	<label for="pname">Tên hình:</label>
                    	<div class="txt">
                        	<input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.SLIDESHOW_POST.pname)}{$smarty.session.SLIDESHOW_POST.pname}{/if}" maxlength="255" />
                      	</div>
                     </li>
                 {/if}
                 <li>           
                 	<button type="submit"><strong>Lưu dữ liệu</strong></button>
                    <button type="reset"><strong>Nhập lại</strong></button>      	                    
                 </li>
            </ul>
        </form>                                               
        {include file="slideshow/box-img.tpl"}
  	</article>
</section>
{include file="common/footer.tpl"}
                
